package com.wc.alorithm_blue_bridge._模拟.Q2120;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/10/23 23:05
 * @description 纸张尺寸
 * https://www.lanqiao.cn/problems/2120/learning/?page=3&first_category_id=1&sort=students_count&second_category_id=3
 */
public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int num = s.charAt(1) - '0';
//        System.out.println(num);
        int[] nums = new int[]{1189, 841};
        while (num-- > 0) {
            nums[0] /= 2;
            if (nums[0] < nums[1]) {
                main.swap(nums, 0, 1);
            }
        }
        System.out.println(nums[0] + "\n" + nums[1]);
        sc.close();
    }

    public void swap(int[] num, int i, int j) {
        int tmp = num[i];
        num[i] = num[j];
        num[j] = tmp;
    }
}
